home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
LIBRARY
/
PASCALL
/
TEMPJUNK
/
DRAW.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-12-19
|
899b
|
53 lines
program draw;
uses
crt,graph;
const
x:integer=320;
y:integer=240;
procedure setupgraph;
var
graphdriver,graphmode:integer;
begin
graphdriver:=mcga;
graphmode:=mcgahi;
initgraph(graphdriver,graphmode,'c:\tp\bgi');
if graphresult<>grOk then halt;
cleardevice;
end;
procedure setpoint(a:char);
const
numbers=['0'..'9'];
begin
if not(a in numbers) then exit;
case a of
'1'..'3': y:=y+1;
'4'..'6': y:=y;
'7'..'9': y:=y-1;
end;
case a of
'1','4','7': x:=x-1;
'2','5','8': x:=x;
'3','6','9': x:=x+1;
end;
end;
procedure control;
var
a:char;
begin
setupgraph;
repeat
a:=readkey;
setpoint(a);
putpixel(x,y,white);
until upcase(a)='S';
end;
begin
control;
end.